﻿
@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <link href="~/Content/bootstrap-3.3.7-dist/css/bootstrap.min.css" rel="stylesheet" />
    <link href="~/Content/Tree/jsTree/style.min.css" rel="stylesheet" />
    <title>Chauffeur</title>
    <style type="text/css">
        .modal-header {
            padding: 6px 5px;
            border-bottom: none;
            background: #d8d8d2;
            text-align: center;
            color: #000;
        }

        .modal-content {
            padding: 6px;
        }

        .modal-body {
            padding: 0 25px;
        }

        .btn {
            /*background:#d8d8d2;*/
            background: #d8d8d2;
            margin-top: 5px;
            /*color:#fff;*/
        }

            .btn:hover {
                background: #5190f8;
            }

        .container {
            width: 100%;
        }
        /*.panel-body{
            padding:0;
        }*/
        .panel-heading {
            font-size: 16px;
            text-align: center;
            background-color:#d8d8d2;
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="row">
            <div class="panel-heading">
                <span>司机信息</span>
            </div>
        </div>
        <div class="row">
            <div class="col-lg-12 col-md-10 col-sm-10">
                <button class="btn  glyphicon glyphicon-off" type="button" id="Close"> 关闭</button>
                <button class="btn  glyphicon glyphicon-refresh" type="button" id="Refresh"> 刷新</button>
                <button class="btn  glyphicon glyphicon-plus" type="button" id="Insert"> 新增</button>
                <button class="btn  glyphicon glyphicon-pencil" type="button" id="Update"> 编辑</button>
                <button class="btn  glyphicon glyphicon-remove" type="button" id="Delete"> 删除</button>
                <button class="btn  glyphicon glyphicon-search" type="button" id="Check"> 查询</button>
                <button class="btn  glyphicon glyphicon-print" type="button" id="Print"> 打印</button>
                <button class="btn  glyphicon glyphicon-paste" type="button" id="ExportToExcel"> 导出</button>
            </div>
            <div class="col-lg-12 col-md-12 col-sm-12" style="float:right">
                <div class="panel-body">
                    <div class="row examineeInfor">
                        <table id="Chauffeur" class="table table-condensed" style="width:100%">
                            <thead>
                                <tr>
                                    <th w_index="ChauffeurID" w_check="true">选择</th>
                                    <th w_num="total_line">序号</th>
                                    <th w_index="ChauffeurNumber" width="">司机编号</th>
                                    <th w_index="ChauffeurName" width="">司机姓名</th>
                                    <th w_index="Sex" width="">性别</th>
                                    <th w_index="ChineseName" width="">所属机构</th>
                                    <th w_index="ClientType" width="">所属车队</th>
                                    <th w_index="DeductRatio" width="">提成比例%</th>
                                    <th w_index="ICNumber" width="">IC卡号</th>
                                    <th w_index="PhoneOne" width="">手机</th>
                                    <th w_render="SetState">是否启用</th>
                                    <th w_index="WhetherStart" w_hidden="true">启用</th>
                                </tr>
                            </thead>
                        </table>
                    </div>
                </div>
            </div>
        </div>
        @*新增模态框*@
        <div class="container">
            <div class="modal  bs-example-modal-sm" id="modInsertExaminee">
                <div class="modal-content" style="width:1300px;height:825px;margin-left:120px;">
                    <div class="modal-header">
                        <h5 class="modal-title glyphicon glyphicon-plus"> 司机资料</h5>
                    </div>
                    <div class="modal-body">
                        <form class="form-horizontal" role="form" id="formInsert" action="/Basics/Basics/insertChauffeur" method="post">
                            <div class="row" style="margin-top:5px">
                                <div class="col-lg-8 col-md-8 col-sm-8" style="float:left;">
                                    <div class="col-lg-3 col-md-3 col-sm-3 text-right">
                                        <label class="control-label">司机姓名:</label>
                                    </div>
                                    <div class="col-lg-3 col-md-3 col-sm-3">
                                        <input type="text" class="form-control" name="ChauffeurName" maxlength="10" onkeyup="value=value.replace(/[^\u4E00-\u9FA5]/g,'')" />
                                    </div>
                                    <div class="col-lg-3 col-md-3 col-sm-3 text-right">
                                        <label class="control-label">司机编号:</label>
                                    </div>
                                    <div class="col-lg-3 col-md-3 col-sm-3">
                                        <input type="text" class="form-control" name="ChauffeurNumber" maxlength="10" onkeyup="value = value.replace(/[^A-Z]+$/,'')" />
                                    </div>
                                </div>
                                <div class="col-lg-8 col-md-8 col-sm-8" style="float:left;">
                                    <div class="col-lg-3 col-md-2 col-sm-2 text-right">
                                        <label class="control-label">性别:</label>
                                    </div>
                                    <div class="col-lg-3 col-md-2 col-sm-2">
                                        <select class="form-control" name="Sex">
                                            <option value="0">----请选择----</option>
                                            <option value="男">男</option>
                                            <option value="女">女</option>
                                        </select>
                                    </div>
                                    <div class="col-lg-3 col-md-2 col-sm-2 text-right">
                                        <label class="control-label">英文名:</label>
                                    </div>
                                    <div class="col-lg-3 col-md-2 col-sm-2">
                                        <input type="text" class="form-control" name="EnglishName" maxlength="10" onkeyup="value = value.replace(/[^a-z/A-Z$]/,'')" />
                                    </div>
                                </div>
                                <div class="col-lg-8 col-md-12 col-sm-12" style="float:left;">
                                    <div class="col-lg-3 col-md-2 col-sm-2 text-right">
                                        <label class="control-label">籍贯:</label>
                                    </div>
                                    <div class="col-lg-3 col-md-2 col-sm-2">
                                        <select class="form-control" name="Address">
                                            <option value="0">----请选择----</option>
                                            <option value="安徽省">安徽省</option>
                                            <option value="北京省">北京省</option>
                                            <option value="重庆省">重庆省</option>
                                            <option value="福建省">福建省</option>
                                            <option value="贵州省">贵州省</option>
                                            <option value="广东省">广东省</option>
                                            <option value="甘肃省">甘肃省</option>
                                            <option value="黑龙江">黑龙江</option>
                                            <option value="河北省">河北省</option>
                                            <option value="河南省">河南省</option>
                                            <option value="湖北省">湖北省</option>
                                            <option value="湖南省">湖南省</option>
                                            <option value="海南省">海南省</option>
                                            <option value="吉林省">吉林省</option>
                                            <option value="江苏省">江苏省</option>
                                            <option value="江西省">江西省</option>
                                            <option value="辽宁省">辽宁省</option>
                                            <option value="青海省">青海省</option>
                                            <option value="山西省">山西省</option>
                                            <option value="山东省">山东省</option>
                                            <option value="四川省">四川省</option>
                                            <option value="上海省">上海省</option>
                                            <option value="台湾省">台湾省</option>
                                            <option value="天津省">天津省</option>
                                            <option value="陕西省">陕西省</option>
                                            <option value="云南省">云南省</option>
                                            <option value="浙江省">浙江省</option>
                                        </select>
                                    </div>
                                    <div class="col-lg-3 col-md-2 col-sm-2 text-right">
                                        <label class="control-label">生日:</label>
                                    </div>
                                    <div class="col-lg-3 col-md-2 col-sm-2">
                                        <input class="form-control" type="date" name="Birthday">
                                    </div>
                                </div>
                                <div class="col-lg-8 col-md-12 col-sm-12" style="float:left;">
                                    <div class="col-lg-3 col-md-2 col-sm-2 text-right">
                                        <label class="control-label">健康状况:</label>
                                    </div>
                                    <div class="col-lg-3 col-md-2 col-sm-2">
                                        <select class="form-control" name="HealthCondition">
                                            <option value="0">----请选择----</option>
                                            <option value="有疾">有疾</option>
                                            <option value="较差">较差</option>
                                            <option value="一般">一般</option>
                                            <option value="良好">良好</option>
                                            <option value="优秀">优秀</option>
                                        </select>
                                    </div>
                                    <div class="col-lg-3 col-md-2 col-sm-2 text-right">
                                        <label class="control-label">客户类型:</label>
                                    </div>
                                    <div class="col-lg-3 col-md-2 col-sm-2">
                                        <input type="text" class="form-control" name="" value="车队" readonly />
                                    </div>
                                </div>
                                <div class="col-lg-8 col-md-12 col-sm-12" style="float:left;">
                                    <div class="col-lg-3 col-md-2 col-sm-2 text-right">
                                        <label class="control-label">状态:</label>
                                    </div>
                                    <div class="col-lg-3 col-md-2 col-sm-2">
                                        <select class="form-control" name="State">
                                            <option value="">----请选择----</option>
                                            <option value="在职">在职</option>
                                            <option value="离职">离职</option>
                                        </select>
                                    </div>
                                    <div class="col-lg-3 col-md-2 col-sm-2 text-right">
                                        <label class="control-label">所属车队:</label>
                                    </div>
                                    <div class="col-lg-3 col-md-2 col-sm-2">
                                        <select class="form-control" id="ClientType" name="ClientTypeID">
                                            <option value="0">----请选择----</option>
                                        </select>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-lg-8 col-md-12 col-sm-12">
                                        <div class="col-lg-3 col-md-2 col-sm-2 text-right">
                                            <label class="control-label">手机1:</label>
                                        </div>
                                        <div class="col-lg-3 col-md-2 col-sm-2">
                                            <input type="text" class="form-control" name="PhoneOne" maxlength="11" onkeyup="value=value.replace(/[^0-9]/g,'')" />
                                        </div>
                                        <div class="col-lg-3 col-md-2 col-sm-2 text-right">
                                            <label class="control-label">香港手机1:</label>
                                        </div>
                                        <div class="col-lg-3 col-md-2 col-sm-2">
                                            <input type="text" class="form-control" name="HongkongPhoneOne" />
                                        </div>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-lg-8 col-md-12 col-sm-12">
                                        <div class="col-lg-3 col-md-2 col-sm-2 text-right">
                                            <label class="control-label">手机2:</label>
                                        </div>
                                        <div class="col-lg-3 col-md-2 col-sm-2">
                                            <input type="text" class="form-control" id="" name="PhoneTwo" maxlength="11" onkeyup="value=value.replace(/[^0-9]/g,'')" />
                                        </div>
                                        <div class="col-lg-3 col-md-2 col-sm-2 text-right">
                                            <label class="control-label">香港手机2:</label>
                                        </div>
                                        <div class="col-lg-3 col-md-2 col-sm-2">
                                            <input type="text" class="form-control" id="" name="HongkongPhoneTwo" />
                                        </div>
                                    </div>
                                </div>
                                <div class="col-lg-4 col-md-3 col-sm-3" style="float:right;">
                                    <div class="col-lg-3 col-md-2 col-sm-2 text-right" style="margin-top:-240px;">
                                        <label class="control-label">相片:</label>
                                    </div>
                                    <div class="col-lg-9 col-md-2 col-sm-2" style="margin-top:-90px;float:right;">
                                        <div class="img-box">
                                            <img src="" alt="" id="Chauffeurimg" width="200" height="160" style="margin-top:-145px;" />
                                            <input type="file" name="Image" id="ChauffeurPicture" style="width:200px;" />
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="row" style="margin-top:10px;">
                                <div class="col-lg-12 col-md-12 col-sm-12">
                                    <div class="col-lg-2 col-md-2 col-sm-2 text-right">
                                        <label class="control-label">家庭电话:</label>
                                    </div>
                                    <div class="col-lg-2 col-md-2 col-sm-2">
                                        <input type="text" class="form-control" name="FamilyPhone" maxlength="11" />
                                    </div>
                                    <div class="col-lg-2 col-md-2 col-sm-2 text-right">
                                        <label class="control-label">紧急联系人:</label>
                                    </div>
                                    <div class="col-lg-2 col-md-2 col-sm-2">
                                        <input type="text" class="form-control" name="UrgencyRelationer" />
                                    </div>
                                    <div class="col-lg-2 col-md-2 col-sm-2 text-right">
                                        <label class="control-label">紧急联系电话:</label>
                                    </div>
                                    <div class="col-lg-2 col-md-2 col-sm-2">
                                        <input type="text" class="form-control" name="UrgencyRelationerPhone" />
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-lg-12 col-md-12 col-sm-12">
                                    <div class="col-lg-2 col-md-2 col-sm-2 text-right">
                                        <label class="control-label">紧急联系地址:</label>
                                    </div>
                                    <div class="col-lg-10 col-md-10 col-sm-10">
                                        <input type="text" class="form-control" id="" name="UrgencyRelationerSite" />
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-lg-12 col-md-12 col-sm-12">
                                    <div class="col-lg-2 col-md-2 col-sm-2 text-right">
                                        <label class="control-label">保证金:</label>
                                    </div>
                                    <div class="col-lg-2 col-md-2 col-sm-2">
                                        <input type="text" class="form-control" name="CashDeposit" />
                                    </div>
                                    <div class="col-lg-2 col-md-2 col-sm-2 text-right">
                                        <label class="control-label">提成比例%:</label>
                                    </div>
                                    <div class="col-lg-2 col-md-2 col-sm-2">
                                        <input type="text" class="form-control" name="DeductRatio" />
                                    </div>
                                    <div class="col-lg-2 col-md-2 col-sm-2 text-right">
                                        <label class="control-label">薪水:</label>
                                    </div>
                                    <div class="col-lg-2 col-md-2 col-sm-2">
                                        <input type="text" class="form-control" name="Salary" />
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-lg-12 col-md-12 col-sm-12">
                                    <div class="col-lg-2 col-md-2 col-sm-2 text-right">
                                        <label class="control-label">驾驶证:</label>
                                    </div>
                                    <div class="col-lg-2 col-md-2 col-sm-2">
                                        <input type="text" class="form-control" name="DrivingLicence" />
                                    </div>
                                    <div class="col-lg-2 col-md-2 col-sm-2 text-right">
                                        <label class="control-label">年审日期:</label>
                                    </div>
                                    <div class="col-lg-2 col-md-2 col-sm-2">
                                        <input type="date" class="form-control" name="Jsznsrq" />
                                    </div>
                                    <div class="col-lg-2 col-md-2 col-sm-2 text-right">
                                        <label class="control-label">有效日期:</label>
                                    </div>
                                    <div class="col-lg-2 col-md-2 col-sm-2">
                                        <input type="date" class="form-control" name="Jszyxrq" />
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-lg-12 col-md-12 col-sm-12">
                                    <div class="col-lg-2 col-md-2 col-sm-2 text-right">
                                        <label class="control-label">香港驾驶证号:</label>
                                    </div>
                                    <div class="col-lg-2 col-md-2 col-sm-2">
                                        <input type="text" class="form-control" name="Hkjszh" />
                                    </div>
                                    <div class="col-lg-2 col-md-2 col-sm-2 text-right">
                                        <label class="control-label">年审日期:</label>
                                    </div>
                                    <div class="col-lg-2 col-md-2 col-sm-2">
                                        <input type="date" class="form-control" name="Hkjszhnsrq" />
                                    </div>
                                    <div class="col-lg-2 col-md-2 col-sm-2 text-right">
                                        <label class="control-label">录用日期:</label>
                                    </div>
                                    <div class="col-lg-2 col-md-2 col-sm-2">
                                        <input type="date" class="form-control" name="Hkjszhlyrq" />
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-lg-12 col-md-12 col-sm-12">
                                    <div class="col-lg-2 col-md-2 col-sm-2 text-right">
                                        <label class="control-label">IC卡号:</label>
                                    </div>
                                    <div class="col-lg-2 col-md-2 col-sm-2">
                                        <input type="text" class="form-control" name="ICNumber" />
                                    </div>
                                    <div class="col-lg-2 col-md-2 col-sm-2 text-right">
                                        <label class="control-label">年审日期:</label>
                                    </div>
                                    <div class="col-lg-2 col-md-2 col-sm-2">
                                        <input type="date" class="form-control" name="ICNsrq" />
                                    </div>
                                    <div class="col-lg-2 col-md-2 col-sm-2 text-right">
                                        <label class="control-label">回乡证号:</label>
                                    </div>
                                    <div class="col-lg-2 col-md-2 col-sm-2">
                                        <input type="text" class="form-control" name="Hxzh" />
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-lg-12 col-md-12 col-sm-12">
                                    <div class="col-lg-2 col-md-2 col-sm-2 text-right">
                                        <label class="control-label">资格证:</label>
                                    </div>
                                    <div class="col-lg-2 col-md-2 col-sm-2">
                                        <input type="text" class="form-control" name="StatusCard" />
                                    </div>
                                    <div class="col-lg-2 col-md-2 col-sm-2 text-right">
                                        <label class="control-label">年审日期:</label>
                                    </div>
                                    <div class="col-lg-2 col-md-2 col-sm-2">
                                        <input type="date" class="form-control" name="StatusCardNsrq" />
                                    </div>
                                    <div class="col-lg-2 col-md-2 col-sm-2 text-right">
                                        <label class="control-label">社保证号:</label>
                                    </div>
                                    <div class="col-lg-2 col-md-2 col-sm-2">
                                        <input type="text" class="form-control" name="SocialSecurityCardNumber" />
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-lg-12 col-md-12 col-sm-12">
                                    <div class="col-lg-2 col-md-2 col-sm-2 text-right">
                                        <label class="control-label">合格证:</label>
                                    </div>
                                    <div class="col-lg-2 col-md-2 col-sm-2">
                                        <input type="text" class="form-control" name="CertificateQualification" />
                                    </div>
                                    <div class="col-lg-2 col-md-2 col-sm-2 text-right">
                                        <label class="control-label">年审日期:</label>
                                    </div>
                                    <div class="col-lg-2 col-md-2 col-sm-2">
                                        <input type="date" class="form-control" name="CertificateQualificationNsrq" />
                                    </div>
                                    <div class="col-lg-2 col-md-2 col-sm-2 text-right">
                                        <label class="control-label">所属组织结构:</label>
                                    </div>
                                    <div class="col-lg-2 col-md-2 col-sm-2">
                                        <select class="form-control" id="Message" name="MessageID">
                                            <option value="0">----请选择----</option>
                                        </select>
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-lg-12 col-md-12 col-sm-12">
                                    <div class="col-lg-2 col-md-2 col-sm-2 text-right">
                                        <label class="control-label">上岗证:</label>
                                    </div>
                                    <div class="col-lg-2 col-md-2 col-sm-2">
                                        <input type="text" class="form-control" name="WorkLicense" />
                                    </div>
                                    <div class="col-lg-2 col-md-2 col-sm-2 text-right">
                                        <label class="control-label">年审日期:</label>
                                    </div>
                                    <div class="col-lg-2 col-md-2 col-sm-2">
                                        <input type="date" class="form-control" name="WorkLicenseNsrq" />
                                    </div>
                                    <div class="col-lg-1 col-md-1 col-sm-1" style="margin-left:100px;padding:1px 1px;margin-top:10px;">
                                        <label>
                                            <input type="checkbox" name="FenGSKJ" value="true" />
                                            分公司可见
                                        </label>
                                    </div>
                                    <div class="col-lg-1 col-md-1 col-sm-1" style="margin-top:11px;">
                                        <label>
                                            <input type="checkbox" name="WhetherStart" value="true" />
                                            是否启用
                                        </label>
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-lg-12 col-md-12 col-sm-12">
                                    <div class="col-lg-2 col-md-2 col-sm-2 text-right">
                                        <label class="control-label">身份证:</label>
                                    </div>
                                    <div class="col-lg-10 col-md-10 col-sm-10">
                                        <input type="text" class="form-control" id="IdentityCard" name="IdentityCard" maxlength="18" />
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-lg-12 col-md-12 col-sm-12">
                                    <div class="col-lg-2 col-md-2 col-sm-2 text-right">
                                        <label class="control-label">居住地:</label>
                                    </div>
                                    <div class="col-lg-10 col-md-10 col-sm-10">
                                        <input type="text" class="form-control" name="Apartment" />
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-lg-12 col-md-12 col-sm-12">
                                    <div class="col-lg-2 col-md-3 col-sm-2 text-right">
                                        <label class="control-label">户口所在地:</label>
                                    </div>
                                    <div class="col-lg-10 col-md-10 col-sm-10">
                                        <input type="text" class="form-control" name="RegisteredPermanent" />
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-lg-12 col-md-12 col-sm-12">
                                    <div class="col-lg-2 col-md-2 col-sm-2 text-right">
                                        <label class="control-label">香港居住地:</label>
                                    </div>
                                    <div class="col-lg-10 col-md-10 col-sm-10">
                                        <input type="text" class="form-control" name="HongKongPermanent" />
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-lg-12 col-md-12 col-sm-12">
                                    <div class="col-lg-2 col-md-2 col-sm-2 text-right">
                                        <label class="control-label">描述:</label>
                                    </div>
                                    <div class="col-lg-10 col-md-10 col-sm-10">
                                        <input type="text" class="form-control" name="Describe" />
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-lg-12 col-md-12 col-sm-12 col-lg-offset-9">
                                    <button class="btn glyphicon glyphicon-repeat" type="reset"> 重置</button>
                                    <button class="btn glyphicon glyphicon-ok" type="button" id="SaveChauffeur"> 保存</button>
                                    <button class="btn glyphicon glyphicon-remove" data-dismiss="modal"> 关闭</button>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
        @*修改模态框*@
        <div class="container">
            <div class="modal  bs-example-modal-sm" id="modUpdateExaminee">
                <div class="modal-content" style="width:1300px;height:830px;margin-left:120px;">
                    <div class="modal-header">
                        <h5 class="modal-title glyphicon glyphicon-pencil"> 司机资料</h5>
                    </div>
                    <div class="modal-body">
                        <form class="form-horizontal" role="form" id="formUpdate" action="" method="post">
                            <div class="row" style="margin-top:5px">
                                <div class="col-lg-8 col-md-8 col-sm-8" style="float:left;">
                                    <div class="col-lg-3 col-md-3 col-sm-3 text-right">
                                        <label class="control-label">司机姓名:</label>
                                    </div>
                                    <div class="col-lg-3 col-md-3 col-sm-3">
                                        <input type="text" class="form-control" name="ChauffeurName" maxlength="10" onkeyup="value=value.replace(/[^\u4E00-\u9FA5]/g,'')" />
                                    </div>
                                    <div class="col-lg-3 col-md-3 col-sm-3 text-right">
                                        <label class="control-label">司机编号:</label>
                                    </div>
                                    <div class="col-lg-3 col-md-3 col-sm-3">
                                        <input type="text" class="form-control" name="ChauffeurNumber" maxlength="10" onkeyup="value = value.replace(/[^A-Z]+$/,'')" />
                                    </div>
                                </div>
                                <div class="col-lg-8 col-md-8 col-sm-8" style="float:left;">
                                    <div class="col-lg-3 col-md-2 col-sm-2 text-right">
                                        <label class="control-label">性别:</label>
                                    </div>
                                    <div class="col-lg-3 col-md-2 col-sm-2">
                                        <select class="form-control" name="Sex">
                                            <option value="0">----请选择----</option>
                                            <option value="男">男</option>
                                            <option value="女">女</option>
                                        </select>
                                    </div>
                                    <div class="col-lg-3 col-md-2 col-sm-2 text-right">
                                        <label class="control-label">英文名:</label>
                                    </div>
                                    <div class="col-lg-3 col-md-2 col-sm-2">
                                        <input type="text" class="form-control" name="EnglishName" maxlength="10" onkeyup="value = value.replace(/[^a-z/A-Z$]/,'')" />
                                    </div>
                                </div>
                                <div class="col-lg-8 col-md-12 col-sm-12" style="float:left;">
                                    <div class="col-lg-3 col-md-2 col-sm-2 text-right">
                                        <label class="control-label">籍贯:</label>
                                    </div>
                                    <div class="col-lg-3 col-md-2 col-sm-2">
                                        <select class="form-control" name="Address">
                                            <option value="0">----请选择----</option>
                                            <option value="安徽省">安徽省</option>
                                            <option value="北京省">北京省</option>
                                            <option value="重庆省">重庆省</option>
                                            <option value="福建省">福建省</option>
                                            <option value="贵州省">贵州省</option>
                                            <option value="广东省">广东省</option>
                                            <option value="甘肃省">甘肃省</option>
                                            <option value="黑龙江">黑龙江</option>
                                            <option value="河北省">河北省</option>
                                            <option value="河南省">河南省</option>
                                            <option value="湖北省">湖北省</option>
                                            <option value="湖南省">湖南省</option>
                                            <option value="海南省">海南省</option>
                                            <option value="吉林省">吉林省</option>
                                            <option value="江苏省">江苏省</option>
                                            <option value="江西省">江西省</option>
                                            <option value="辽宁省">辽宁省</option>
                                            <option value="青海省">青海省</option>
                                            <option value="山西省">山西省</option>
                                            <option value="山东省">山东省</option>
                                            <option value="四川省">四川省</option>
                                            <option value="上海省">上海省</option>
                                            <option value="台湾省">台湾省</option>
                                            <option value="天津省">天津省</option>
                                            <option value="陕西省">陕西省</option>
                                            <option value="云南省">云南省</option>
                                            <option value="浙江省">浙江省</option>
                                        </select>
                                    </div>
                                    <div class="col-lg-3 col-md-2 col-sm-2 text-right">
                                        <label class="control-label">生日:</label>
                                    </div>
                                    <div class="col-lg-3 col-md-2 col-sm-2">
                                        <input class="form-control" type="date" name="Birthday">
                                    </div>
                                </div>
                                <div class="col-lg-8 col-md-12 col-sm-12" style="float:left;">
                                    <div class="col-lg-3 col-md-2 col-sm-2 text-right">
                                        <label class="control-label">健康状况:</label>
                                    </div>
                                    <div class="col-lg-3 col-md-2 col-sm-2">
                                        <select class="form-control" name="HealthCondition">
                                            <option value="0">----请选择----</option>
                                            <option value="有疾">有疾</option>
                                            <option value="较差">较差</option>
                                            <option value="一般">一般</option>
                                            <option value="良好">良好</option>
                                            <option value="优秀">优秀</option>
                                        </select>
                                    </div>
                                    <div class="col-lg-3 col-md-2 col-sm-2 text-right">
                                        <label class="control-label">客户类型:</label>
                                    </div>
                                    <div class="col-lg-3 col-md-2 col-sm-2">
                                        <input type="text" class="form-control" name="" value="车队" readonly />
                                    </div>
                                </div>
                                <div class="col-lg-8 col-md-12 col-sm-12" style="float:left;">
                                    <div class="col-lg-3 col-md-2 col-sm-2 text-right">
                                        <label class="control-label">状态:</label>
                                    </div>
                                    <div class="col-lg-3 col-md-2 col-sm-2">
                                        <select class="form-control" name="State">
                                            <option value="0">----请选择----</option>
                                            <option value="在职">在职</option>
                                            <option value="离职">离职</option>
                                        </select>
                                    </div>
                                    <div class="col-lg-3 col-md-2 col-sm-2 text-right">
                                        <label class="control-label">所属车队:</label>
                                    </div>
                                    <div class="col-lg-3 col-md-2 col-sm-2">
                                        <select class="form-control" id="ClientTypee" name="ClientTypeID">
                                            <option value="0">----请选择----</option>
                                        </select>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-lg-8 col-md-12 col-sm-12">
                                        <div class="col-lg-3 col-md-2 col-sm-2 text-right">
                                            <label class="control-label">手机1:</label>
                                        </div>
                                        <div class="col-lg-3 col-md-2 col-sm-2">
                                            <input type="text" class="form-control" name="PhoneOne" maxlength="11" onkeyup="value=value.replace(/[^0-9]/g,'')" />
                                        </div>
                                        <div class="col-lg-3 col-md-2 col-sm-2 text-right">
                                            <label class="control-label">香港手机1:</label>
                                        </div>
                                        <div class="col-lg-3 col-md-2 col-sm-2">
                                            <input type="text" class="form-control" name="HongkongPhoneOne" />
                                        </div>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-lg-8 col-md-12 col-sm-12">
                                        <div class="col-lg-3 col-md-2 col-sm-2 text-right">
                                            <label class="control-label">手机2:</label>
                                        </div>
                                        <div class="col-lg-3 col-md-2 col-sm-2">
                                            <input type="text" class="form-control" name="PhoneTwo" maxlength="11" onkeyup="value=value.replace(/[^0-9]/g,'')" />
                                        </div>
                                        <div class="col-lg-3 col-md-2 col-sm-2 text-right">
                                            <label class="control-label">香港手机2:</label>
                                        </div>
                                        <div class="col-lg-3 col-md-2 col-sm-2">
                                            <input type="text" class="form-control" name="HongkongPhoneTwo" />
                                        </div>
                                    </div>
                                </div>
                                <div class="col-lg-4 col-md-3 col-sm-3" style="float:right;">
                                    <div class="col-lg-3 col-md-2 col-sm-2 text-right" style="margin-top:-240px;">
                                        <label class="control-label">相片:</label>
                                    </div>
                                    <div class="col-lg-9 col-md-2 col-sm-2" style="margin-top:-90px;float:right;">
                                        <div class="img-box">
                                            <img src="" alt="" id="Chauffeurimgxiu" width="200" height="160" style="margin-top:-145px;" />
                                            <input type="file" name="Image" id="ChauffeurPicturexiu" style="width:200px;" />
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="row" style="margin-top:10px;">
                                <div class="col-lg-12 col-md-12 col-sm-12">
                                    <div class="col-lg-2 col-md-2 col-sm-2 text-right">
                                        <label class="control-label">家庭电话:</label>
                                    </div>
                                    <div class="col-lg-2 col-md-2 col-sm-2">
                                        <input type="text" class="form-control" name="FamilyPhone" maxlength="11" />
                                    </div>
                                    <div class="col-lg-2 col-md-2 col-sm-2 text-right">
                                        <label class="control-label">紧急联系人:</label>
                                    </div>
                                    <div class="col-lg-2 col-md-2 col-sm-2">
                                        <input type="text" class="form-control" name="UrgencyRelationer" />
                                    </div>
                                    <div class="col-lg-2 col-md-2 col-sm-2 text-right">
                                        <label class="control-label">紧急联系电话:</label>
                                    </div>
                                    <div class="col-lg-2 col-md-2 col-sm-2">
                                        <input type="text" class="form-control" name="UrgencyRelationerPhone" />
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-lg-12 col-md-12 col-sm-12">
                                    <div class="col-lg-2 col-md-2 col-sm-2 text-right">
                                        <label class="control-label">紧急联系地址:</label>
                                    </div>
                                    <div class="col-lg-10 col-md-10 col-sm-10">
                                        <input type="text" class="form-control" name="UrgencyRelationerSite" />
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-lg-12 col-md-12 col-sm-12">
                                    <div class="col-lg-2 col-md-2 col-sm-2 text-right">
                                        <label class="control-label">保证金:</label>
                                    </div>
                                    <div class="col-lg-2 col-md-2 col-sm-2">
                                        <input type="text" class="form-control" name="CashDeposit" />
                                    </div>
                                    <div class="col-lg-2 col-md-2 col-sm-2 text-right">
                                        <label class="control-label">提成比例%:</label>
                                    </div>
                                    <div class="col-lg-2 col-md-2 col-sm-2">
                                        <input type="text" class="form-control" name="DeductRatio" />
                                    </div>
                                    <div class="col-lg-2 col-md-2 col-sm-2 text-right">
                                        <label class="control-label">薪水:</label>
                                    </div>
                                    <div class="col-lg-2 col-md-2 col-sm-2">
                                        <input type="text" class="form-control" name="Salary" />
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-lg-12 col-md-12 col-sm-12">
                                    <div class="col-lg-2 col-md-2 col-sm-2 text-right">
                                        <label class="control-label">驾驶证:</label>
                                    </div>
                                    <div class="col-lg-2 col-md-2 col-sm-2">
                                        <input type="text" class="form-control" name="DrivingLicence" />
                                    </div>
                                    <div class="col-lg-2 col-md-2 col-sm-2 text-right">
                                        <label class="control-label">年审日期:</label>
                                    </div>
                                    <div class="col-lg-2 col-md-2 col-sm-2">
                                        <input type="date" class="form-control" name="Jsznsrq" />
                                    </div>
                                    <div class="col-lg-2 col-md-2 col-sm-2 text-right">
                                        <label class="control-label">有效日期:</label>
                                    </div>
                                    <div class="col-lg-2 col-md-2 col-sm-2">
                                        <input type="date" class="form-control" name="Jszyxrq" />
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-lg-12 col-md-12 col-sm-12">
                                    <div class="col-lg-2 col-md-2 col-sm-2 text-right">
                                        <label class="control-label">香港驾驶证号:</label>
                                    </div>
                                    <div class="col-lg-2 col-md-2 col-sm-2">
                                        <input type="text" class="form-control" name="Hkjszh" />
                                    </div>
                                    <div class="col-lg-2 col-md-2 col-sm-2 text-right">
                                        <label class="control-label">年审日期:</label>
                                    </div>
                                    <div class="col-lg-2 col-md-2 col-sm-2">
                                        <input type="date" class="form-control" name="Hkjszhnsrq" />
                                    </div>
                                    <div class="col-lg-2 col-md-2 col-sm-2 text-right">
                                        <label class="control-label">录用日期:</label>
                                    </div>
                                    <div class="col-lg-2 col-md-2 col-sm-2">
                                        <input type="date" class="form-control" name="Hkjszhlyrq" />
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-lg-12 col-md-12 col-sm-12">
                                    <div class="col-lg-2 col-md-2 col-sm-2 text-right">
                                        <label class="control-label">IC卡号:</label>
                                    </div>
                                    <div class="col-lg-2 col-md-2 col-sm-2">
                                        <input type="text" class="form-control" name="ICNumber" />
                                    </div>
                                    <div class="col-lg-2 col-md-2 col-sm-2 text-right">
                                        <label class="control-label">年审日期:</label>
                                    </div>
                                    <div class="col-lg-2 col-md-2 col-sm-2">
                                        <input type="date" class="form-control" name="ICNsrq" />
                                    </div>
                                    <div class="col-lg-2 col-md-2 col-sm-2 text-right">
                                        <label class="control-label">回乡证号:</label>
                                    </div>
                                    <div class="col-lg-2 col-md-2 col-sm-2">
                                        <input type="text" class="form-control" name="Hxzh" />
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-lg-12 col-md-12 col-sm-12">
                                    <div class="col-lg-2 col-md-2 col-sm-2 text-right">
                                        <label class="control-label">资格证:</label>
                                    </div>
                                    <div class="col-lg-2 col-md-2 col-sm-2">
                                        <input type="text" class="form-control" name="StatusCard" />
                                    </div>
                                    <div class="col-lg-2 col-md-2 col-sm-2 text-right">
                                        <label class="control-label">年审日期:</label>
                                    </div>
                                    <div class="col-lg-2 col-md-2 col-sm-2">
                                        <input type="date" class="form-control" name="StatusCardNsrq" />
                                    </div>
                                    <div class="col-lg-2 col-md-2 col-sm-2 text-right">
                                        <label class="control-label">社保证号:</label>
                                    </div>
                                    <div class="col-lg-2 col-md-2 col-sm-2">
                                        <input type="text" class="form-control" name="SocialSecurityCardNumber" />
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-lg-12 col-md-12 col-sm-12">
                                    <div class="col-lg-2 col-md-2 col-sm-2 text-right">
                                        <label class="control-label">合格证:</label>
                                    </div>
                                    <div class="col-lg-2 col-md-2 col-sm-2">
                                        <input type="text" class="form-control" name="CertificateQualification" />
                                    </div>
                                    <div class="col-lg-2 col-md-2 col-sm-2 text-right">
                                        <label class="control-label">年审日期:</label>
                                    </div>
                                    <div class="col-lg-2 col-md-2 col-sm-2">
                                        <input type="date" class="form-control" name="CertificateQualificationNsrq" />
                                    </div>
                                    <div class="col-lg-2 col-md-2 col-sm-2 text-right">
                                        <label class="control-label">所属组织结构:</label>
                                    </div>
                                    <div class="col-lg-2 col-md-2 col-sm-2">
                                        <select class="form-control" id="Messagee" name="MessageID">
                                            <option value="0">----请选择----</option>
                                        </select>
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-lg-12 col-md-12 col-sm-12">
                                    <div class="col-lg-2 col-md-2 col-sm-2 text-right">
                                        <label class="control-label">上岗证:</label>
                                    </div>
                                    <div class="col-lg-2 col-md-2 col-sm-2">
                                        <input type="text" class="form-control" name="WorkLicense" />
                                    </div>
                                    <div class="col-lg-2 col-md-2 col-sm-2 text-right">
                                        <label class="control-label">年审日期:</label>
                                    </div>
                                    <div class="col-lg-2 col-md-2 col-sm-2">
                                        <input type="date" class="form-control" name="WorkLicenseNsrq" />
                                    </div>
                                    <div class="col-lg-1 col-md-1 col-sm-1" style="margin-left:100px;padding:1px 1px;margin-top:10px;">
                                        <label>
                                            <input type="checkbox" name="FenGSKJ" value="true" />
                                            分公司可见
                                        </label>
                                    </div>
                                    <div class="col-lg-1 col-md-1 col-sm-1" style="margin-top:11px;">
                                        <label>
                                            <input type="checkbox" name="WhetherStart" value="true" />
                                            是否启用
                                        </label>
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-lg-12 col-md-12 col-sm-12">
                                    <div class="col-lg-2 col-md-2 col-sm-2 text-right">
                                        <label class="control-label">身份证:</label>
                                    </div>
                                    <div class="col-lg-10 col-md-10 col-sm-10">
                                        <input type="text" class="form-control" id="IdentityCard" name="IdentityCard" maxlength="18" />
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-lg-12 col-md-12 col-sm-12">
                                    <div class="col-lg-2 col-md-2 col-sm-2 text-right">
                                        <label class="control-label">居住地:</label>
                                    </div>
                                    <div class="col-lg-10 col-md-10 col-sm-10">
                                        <input type="text" class="form-control" name="Apartment" />
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-lg-12 col-md-12 col-sm-12">
                                    <div class="col-lg-2 col-md-3 col-sm-2 text-right">
                                        <label class="control-label">户口所在地:</label>
                                    </div>
                                    <div class="col-lg-10 col-md-10 col-sm-10">
                                        <input type="text" class="form-control" name="RegisteredPermanent" />
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-lg-12 col-md-12 col-sm-12">
                                    <div class="col-lg-2 col-md-2 col-sm-2 text-right">
                                        <label class="control-label">香港居住地:</label>
                                    </div>
                                    <div class="col-lg-10 col-md-10 col-sm-10">
                                        <input type="text" class="form-control" name="HongKongPermanent" />
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-lg-12 col-md-12 col-sm-12">
                                    <div class="col-lg-2 col-md-2 col-sm-2 text-right">
                                        <label class="control-label">描述:</label>
                                    </div>
                                    <div class="col-lg-10 col-md-10 col-sm-10">
                                        <input type="text" class="form-control" name="Describe" />
                                    </div>
                                </div>
                            </div>
                            <div class="row" style="margin-top:5px;">
                                <div class="col-lg-11 col-md-8 col-sm-10 col-lg-offset-9">
                                    <button class="btn glyphicon glyphicon-repeat" type="reset"> 重置</button>
                                    <button class="btn glyphicon glyphicon-ok" type="button" id="UpdateSave"> 保存</button>
                                    <button class="btn glyphicon glyphicon-remove" data-dismiss="modal"> 关闭</button>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
        @*查询模态框*@
        <div class="modal  bs-example-modal-sm" id="modCheckExaminee">
            <div class="modal-content" style="width:360px;height:175px;margin-left:610px;">
                <div class="modal-header">
                    <h5 class="modal-title glyphicon glyphicon-search"> 查询司机资料</h5>
                </div>
                <form id="formCheckchauffeur">
                    <div class="modal-body">
                        <div class="row" style="margin-top:5px;">
                            <div class="col-lg-12 col-md-12 col-sm-12">
                                <div class="col-lg-4 col-md-4 col-sm-4 text-right">
                                    <label class="control-label">司机编号:</label>
                                </div>
                                <div class="col-lg-8 col-md-8 col-sm-8">
                                    <input type="text" class="form-control" id="ChauffeurNumber" maxlength="10" onkeyup="value = value.replace(/[^A-Z]+$/,'')" />
                                </div>
                            </div>
                        </div>
                        <div class="row" style="margin-top:5px;">
                            <div class="col-lg-12 col-md-12 col-sm-12">
                                <div class="col-lg-4 col-md-4 col-sm-4 text-right">
                                    <label class="control-label">司机姓名:</label>
                                </div>
                                <div class="col-lg-8 col-md-8 col-sm-8">
                                    <input type="text" class="form-control" id="ChauffeurName" maxlength="10" onkeyup="value=value.replace(/[^\u4E00-\u9FA5]/g,'')" />
                                </div>
                            </div>
                        </div>
                        <div class="row" style="margin-top:5px;">
                            <div class="col-lg-10 col-md-10 col-sm-10 col-lg-offset-5">
                                <button class="btn glyphicon glyphicon-search" type="button" id="modelcheck">查询</button>
                                <button class="btn glyphicon glyphicon-remove" data-dismiss="modal">关闭</button>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </div>
        @*双击回填司机相片*@
        <div class="modal fade" id="modExaminee">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal">&times;</button>
                        <h4 class="modal-title">司机信息</h4>
                    </div>
                    <div class="modal-body">
                        <div class="container-fluid">
                            <div class="row" id="ChauffeurPicture" style="border:1px solid #eee;">
                                <div class="col-lg-5 col-md-5 col-sm-5 ">
                                    <img src="#" alt="Alternate Text" id="ChauffeurPic" class="ChauffeurPic" style="width:200px;height:200px" />
                                </div>
                                <div class="col-lg-7 col-md-7 col-sm-7">
                                    <div class="row">
                                        <label>司机编号：</label>
                                        <label id="Number">XS002</label>
                                    </div>
                                    <div class="row">
                                        <label>司机姓名：</label>
                                        <label id="Name">张统一</label>
                                    </div>
                                    <div class="row">
                                        <label>司机性别：</label>
                                        <label id="ChauffeurSex">男</label>
                                    </div>
                                    <div class="row">
                                        <label>手机：</label>
                                        <label id="phone">通信与信息工程学院</label>
                                    </div>
                                    <div class="row">
                                        <label>身份证号：</label>
                                        <label id="ChauffeurCard">5121459873940238487</label>
                                    </div>
                                    <div class="row">
                                        <label>籍贯：</label>
                                        <label id="ress">？？？？？</label>
                                    </div>
                                    <div class="row">
                                        <label>状态：</label>
                                        <label id="ate">？？？？？</label>
                                    </div>
                                    <div class="row">
                                        <label>提成比例%：</label>
                                        <label id="ductRatio">？？？？？</label>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script src="~/Content/Tree/jquery.min.js"></script>
    <link href="~/Content/jquery.bsgrid-1.37/builds/merged/bsgrid.all.min.css" rel="stylesheet" />
    <script src="~/Content/bootstrap-3.3.7-dist/js/jquery-2.0.3.min.js"></script>
    <script src="~/Content/bootstrap-3.3.7-dist/js/bootstrap.min.js"></script>
    <script src="~/Content/jquery.bsgrid-1.37/builds/merged/bsgrid.all.min.js"></script>
    <script src="~/Content/jquery.bsgrid-1.37/builds/js/lang/grid.zh-CN.min.js"></script>
    <script src="~/Content/js/jquery.form.js"></script>
    <script src="~/Content/js/customfunction.js"></script>
    <script src="~/Content/js/combobox.js"></script>
    <script src="~/Content/layer/layer.js"></script>
    <script src="~/Content/Tree/Tree.js"></script>
    <script src="~/Content/Tree/jstree.min.js"></script>
    <script>
        var tabChauffeur;
        $(function () {
            //查询ship表
            tabChauffeur = $.fn.bsgrid.init('Chauffeur', {
                url: 'selectChauffeur',
                autoLoad: true,//自动加载数据
                stripeRows: true,//隔行变色
                rowHoverColor: true,//划过行变色
                displayBlankRows: true,//是否显示空白行，默认值false
                rowSelectedColor: true,//是否显示选中行背景色
                pageSize: 10,//默认页面大小
                pageSizeSelect: true,//是否选择分页页数下拉框
                pagingLittleToolbar: true,//精简的图标按钮分页工具条
                event: {
                    customRowEvents: {
                        dblclick: function (record, rowIndex, trObj, options) {
                            viewTeacherPic(record);
                        }
                    }
                }
            });
            
        })
        //新增下拉框
        appendOption("Message", "selecttmMessage"); 
        appendOption("ClientType", "selecttClientttype");
        //修改下拉框
        appendOption("Messagee", "selecttmMessage"); 
        appendOption("ClientTypee", "selecttCietype");
        //新增下拉框改变事件
        $("#Message").change(function () {
            var mess = $("#Message").val();
            appendOption("ClientType", "selecttClientttype?MessageID=" + mess);
        })
        //修改下拉框改变事件
        $("#Messagee").change(function () {
            var mess = $("#Messagee").val();
            appendOption("ClientTypee", "selecttCietype?MessageID=" + mess);
        })
        //双击回填司机相片,生成图片
        function viewTeacherPic(record) {
            //清除之前的数据
            console.log(record);
            $("#modExaminee label[attr='id']").text("");
            selectTeacherPic(record.ChauffeurID)
            $("#Number").text(record.ChauffeurNumber);
            $("#Name").text(record.ChauffeurName);
            $("#ChauffeurSex").text(record.Sex);
            $("#phone").text(record.PhoneOne);
            $("#ChauffeurCard").text(record.IdentityCard);
            $("#ress").text(record.Address); ate
            $("#ate").text(record.State); 
            $("#ductRatio").text(record.DeductRatio);
            $("#modExaminee").modal('show');
        }
        //查找图片
        function selectTeacherPic(ChauffeurID) {
            $("#ChauffeurPic").attr("src", "");
            $("#ChauffeurPic").attr("src", "/Basics/Basics/GetChauffeurImage?ChauffeurID=" + ChauffeurID);
        }
        //关闭
        $("#Close").click(function () {
            window.location.href = "/Main/index";
        })
        //刷新
        $("#Refresh").click(function () {
            location.reload();
        })
        //查询
        $("#Check").click(function () {
            $('#formCheckchauffeur').resetForm();
            $("#modCheckExaminee").modal("show");
            $("#modelcheck").click(function () {
                CheckChauffeur(); //多条件查询方法
                $("#modCheckExaminee").modal("hide");
            })
        })
        //查询条件
        function CheckChauffeur() {
            var ChauffeurNumber = $("#ChauffeurNumber").val();
            if (ChauffeurNumber == null || ChauffeurNumber == undefined) {
                ChauffeurNumber = 0;
            }
            var ChauffeurName = $("#ChauffeurName").val();
            if (ChauffeurName == null || ChauffeurName == undefined) {
                ChauffeurName = 0;
            }
            tabChauffeur.search({ ChauffeurNumber: ChauffeurNumber, ChauffeurName: ChauffeurName });
        }
        //true or false
        function SetState(record) {
            var WhetherStart = record.WhetherStart;
            if (WhetherStart) {
                return '<span style="color:blue">√</span>';
            } else {
                return '<span style="color:red">×</span>';
            }
        }
        //身份证号码验证（页面上写的）//1、定义一个全国地区的对象
        var aCity = { 11: "北京", 12: "天津", 13: "河北", 14: "山西", 15: "内蒙古", 21: "辽宁", 22: "吉林", 23: "黑龙江", 31: "上海", 32: "江苏", 33: "浙江", 34: "安徽", 35: "福建", 36: "江西", 37: "山东", 41: "河南", 42: "湖北", 43: "湖南", 44: "广东", 45: "广西", 46: "海南", 50: "重庆", 51: "四川", 52: "贵州", 53: "云南", 54: "西藏", 61: "陕西", 62: "甘肃", 63: "青海", 64: "宁夏", 65: "新疆", 71: "台湾", 81: "香港", 82: "澳门", 91: "国外" }
        //2、正则表达式判断
        function isCardID(sId) {
            var iSum = 0;
            var info = "";
            if (!/^\d{17}(\d|x)$/i.test(sId)) return "你输入的身份证长度或格式错误";
            sId = sId.replace(/x$/i, "a");
            if (aCity[parseInt(sId.substr(0, 2))] == null) return "你的身份证地区非法";
            sBirthday = sId.substr(6, 4) + "-" + Number(sId.substr(10, 2)) + "-" + Number(sId.substr(12, 2));
            var d = new Date(sBirthday.replace(/-/g, "/"));
            if (sBirthday != (d.getFullYear() + "-" + (d.getMonth() + 1) + "-" + d.getDate())) return "身份证上的出生日期非法";
            for (var i = 17; i >= 0; i--) iSum += (Math.pow(2, i) % 11) * parseInt(sId.charAt(17 - i), 11);
            if (iSum % 11 != 1) return "你输入的身份证号非法";
            //aCity[parseInt(sId.substr(0,2))]+","+sBirthday+","+(sId.substr(16,1)%2?"男":"女");//此次还可以判断出输入的身份证号的人性别
            //acity[parseInt]
            return true;
        }
        $("#IdentityCard").change(function () {
            //获取身份证
            var sId = $("#IdentityCard").val();
            layer.alert(isCardID(sId));
        });
        //新增
        $("#Insert").click(function () {
            $('#formInsert').resetForm();
            $("#modInsertExaminee").modal("show");
            var imgReaderI = new FileReader();//FileReader()接口：用于读取文件
            //图片文件： 正则表达式过滤（此表达式是用来判断上传的文件是否是一张图片）
            regexImgerFilter = /^(?:image\/bmp|image\/png|image\/jpeg|image\/jpg)$/i;
            //调用FileReader接口的onload方法，回调函数得到的evt是图片的URL链接
            imgReaderI.onload = function (evt) {
                //将数据结果赋值给image的src
                $("#Chauffeurimg").attr('src', evt.target.result);
            }
            $("#ChauffeurPicture").change(function () {
                //获取通过“选择文件”的按钮上传的文件
                //prop添加属性名称（跟attr属性一样是给标签添加属性，但是它们是有区别的），加载image标签中
                var imgFile = $("#ChauffeurPicture").prop("files")[0];
                //调用正则表达式过滤图片
                if(!regexImgerFilter.test(imgFile.type)){
                    layer.msg('选择的不是一个有效的图片文件', { icon: 0 });
                }//readAsDataURL()方法可以获取API异步读取的文件数据，另存为数据URL;将该URL绑定到img标签的src属性上，就可以实现图片的上传预览效果了。
                imgReaderI.readAsDataURL(imgFile);
            })
        });
        $("#SaveChauffeur").click(function () {
            var ChauffeurName = $('#formInsert [name="ChauffeurName"]').val();
            var Message = $('#formInsert [name="MessageID"]').val();
            var Sex = $('#formInsert [name="Sex"]').val();
            var ClientTypeID = $('#formInsert [name="ClientTypeID"]').val();
            var IdentityCard = $('#formInsert [name="IdentityCard"]').val();
            var ChauffeurNumber = $('#formInsert [name="ChauffeurNumber"]').val();
            var Address = $('#formInsert [name="Address"]').val();
            var State = $('#formInsert [name="State"]').val();
            var PhoneOne = $('#formInsert [name="PhoneOne"]').val();
            var Image = $('#formInsert [name="Image"]').val();
            var DeductRatio = $('#formInsert [name="DeductRatio"]').val();
            if (ChauffeurName != '') {
                if (Message > 0) {
                    if (Sex != '') {
                        if (ClientTypeID > 0) {
                            if (IdentityCard != '') {
                                if (ChauffeurNumber != '') {
                                    if (Address != '') {
                                        if (State != '') {
                                            if (PhoneOne != '') {
                                                if (Image != '') {
                                                    if (DeductRatio != '') {
                                                        var layerIndex = layer.load(0);
                                                        $("#formInsert").ajaxSubmit(function (msg) {
                                                            layer.close(layerIndex);
                                                            tabChauffeur.search();
                                                            $("#modInsertExaminee").modal("hide");
                                                            layer.alert(msg, { icon: 0, title: '提示' });
                                                        });
                                                    }
                                                    else {
                                                        layer.msg("提成比例%不能为空！", { icon: 0 });
                                                    }
                                                }
                                                else {
                                                    layer.msg("相片不能为空！", { icon: 0 });
                                                }
                                            }
                                            else {
                                                layer.msg("手机1不能为空！", { icon: 0 });
                                            }
                                        }
                                        else {
                                            layer.msg("状态不能为空！", { icon: 0 });
                                        }
                                    }
                                    else {
                                        layer.msg("籍贯不能为空！", { icon: 0 });
                                    }
                                }
                                else {
                                    layer.msg("司机编号不能为空！", { icon: 0 });
                                }
                            }
                            else {
                                layer.msg("身份证不能为空！", { icon: 0 });
                            }
                        }
                        else {
                            layer.msg("所属车队不能为空！", { icon: 0 });
                        }
                    }
                    else {
                        layer.msg("性别不能为空！", { icon: 0 });
                    }
                }
                else {
                    layer.msg("所属组织不能为空！", { icon: 0 });
                }
            }
            else {
                layer.msg("司机姓名不能为空！", { icon: 0 });
            }
        })
        //编辑
        $("#Update").click(function () {
            var check = $("#Chauffeur input:checked");
            if (check.length == 0) {
                layer.msg("请选择一条信息!", { icon: 0 });
            }
            if (check.length > 1) {
                layer.msg("只能选择一条信息!", { icon: 0 });
            }
            if (check.length == 1) {
                var ChauffeurID = tabChauffeur.getColumnValue(check, "ChauffeurID");
                $("#Chauffeurimgxiu").attr("src", "");
                $("#Chauffeurimgxiu").attr("src", "/Basics/Basics/ChauffeurImage?ChauffeurID=" + ChauffeurID);

                $.post("/Basics/Basics/SelectChauffeurById", { ChauffeurID: check[0].value }, function (data) {
                    loadDatatoForm("formUpdate", data);
                })
                $("#modUpdateExaminee").modal("show");
            }
        })
        var imgReaderU = new FileReader();
        imgReaderU.onload = function (evt) {
            $("#Chauffeurimgxiu").attr('src', evt.target.result);
        };
        $("#ChauffeurPicturexiu").change(function () {
            var imgfFile = $("#ChauffeurPicturexiu").prop('files')[0];
            if (!regexImageFilter.test(imgfFile.type)) {
                layer.msg('选择的不是一个有效的图片文件', { icon: 0 });
            }
            imgReaderU.readAsDataURL(imgfFile);
        });
        $("#UpdateSave").click(function () {
            var ChauffeurName = $('#formUpdate [name="ChauffeurName"]').val();
            var Message = $('#formUpdate [name="MessageID"]').val();
            var Sex = $('#formUpdate [name="Sex"]').val();
            var ClientTypeID = $('#formUpdate [name="ClientTypeID"]').val();
            var IdentityCard = $('#formUpdate [name="IdentityCard"]').val();
            var ChauffeurNumber = $('#formUpdate [name="ChauffeurNumber"]').val();
            var Address = $('#formUpdate [name="Address"]').val();
            var State = $('#formUpdate [name="State"]').val();
            var PhoneOne = $('#formUpdate [name="PhoneOne"]').val();
            var Image = $('#formUpdate [name="Image"]').val();
            var DeductRatio = $('#formUpdate [name="DeductRatio"]').val();
            if (ChauffeurName != '') {
                if (Message > 0) {
                    if (Sex != '') {
                        if (ClientTypeID > 0) {
                            if (IdentityCard != '') {
                                if (ChauffeurNumber != '') {
                                    if (Address != '') {
                                        if (State != '') {
                                            if (PhoneOne != '') {
                                                if (Image != '') {
                                                    if (DeductRatio != '') {
                                                        var layerIndex = layer.load(0);
                                                        $("#formUpdate").attr("action", "/Basics/Basics/UpdateChauffeur?ChauffeurID=" + $("#Chauffeur input:checked")[0].value);
                                                        $("#formUpdate").ajaxSubmit(function (msg) {
                                                            layer.close(layerIndex);
                                                            if (msg == "修改成功！") {
                                                                tabChauffeur.refreshPage();
                                                                $("#modUpdateExaminee").modal("hide");
                                                                layer.msg(msg, { icon: 1 });
                                                            }
                                                            else {
                                                                layer.msg(msg, { icon: 0 });
                                                            }
                                                        });
                                                    }
                                                    else {
                                                        layer.msg("提成比例%不能为空！", { icon: 0 });
                                                    }
                                                }
                                                else {
                                                    layer.msg("相片不能为空！", { icon: 0 });
                                                }
                                            }
                                            else {
                                                layer.msg("手机1不能为空！", { icon: 0 });
                                            }
                                        }
                                        else {
                                            layer.msg("状态不能为空！", { icon: 0 });
                                        }
                                    }
                                    else {
                                        layer.msg("籍贯不能为空！", { icon: 0 });
                                    }
                                }
                                else {
                                    layer.msg("司机编号不能为空！", { icon: 0 });
                                }
                            }
                            else {
                                layer.msg("身份证不能为空！", { icon: 0 });
                            }
                        }
                        else {
                            layer.msg("所属车队不能为空！", { icon: 0 });
                        }
                    }
                    else {
                        layer.msg("性别不能为空！", { icon: 0 });
                    }
                }
                else {
                    layer.msg("所属组织不能为空！", { icon: 0 });
                }
            }
            else {
                layer.msg("司机姓名不能为空！", { icon: 0 });
            }
        })
        //删除
        $("#Delete").click(function () {
            var delCount = 0;//记录需要删除的数据的总数
            var returnCount = 0;//记录删除成功的数据的总数
            //获取选中的数据
            var Check = $("#Chauffeur input[type='checkbox']:checked");
            if (Check.length > 0) {
                layer.confirm("确定要删除选中的数据吗？", {
                    icon: 3,
                    btn: ["确定", "取消"],
                    offset: "100px"
                }, function (layerIndex) {
                    layer.close(layerIndex);
                    //计算选中的题目所有作废的数据的总数
                    for (var i = 0; i < Check.length; i++) {
                        //获取索引(获取Check[i]相对于jQuery选择器$("#tbTitlesInfor input[type='checkbox']")的索引)
                        var Index = $("#Chauffeur input[type='checkbox']").index(Check[i]);
                        //根据索引获取行记录值中题目的状态
                        var WhetherStart = tabChauffeur.getRecord(Index).WhetherStart;
                        //判断获取到的题目的状态是否为作废
                        if (!WhetherStart) {
                            delCount++;
                        }
                    }
                    //判断选中的题目是否全部是“已作废”的状态
                    if (delCount == Check.length) {
                        //删除
                        for (var i = 0; i < Check.length; i++) {
                            $.ajax({
                                url: "DelectChauffeur?ChauffeurID=" + Check[i].value,
                                async: false,
                                type: "get",
                                dataType: "json",
                                success: function (data) {
                                    if (data) {
                                        returnCount++;
                                    }
                                }
                            });
                        }
                        if (returnCount == Check.length) {
                            //layer.msg("删除成功", { icon: 1, skin: "layui-layer-molv" });
                            layer.msg("有" + (returnCount) + "条数据删除成功！", { icon: 1 });
                            tabChauffeur.search();
                        }
                        else {
                            layer.msg("有" + (delCount - returnCount) + "条数据存在异常！", { icon: 0 });
                        }
                    }
                    else {
                        layer.msg("选中的数据中存在已启用，不能删除！", { icon: 0 });
                    }
                });
            }
            else {
                layer.msg("请选择需要删除的数据！", { icon: 0 });
            }
        });
        //excel导出
        $("#ExportToExcel").click(function () {
            var ChauffeurNumber = $("#ChauffeurNumber").val();
            if (ChauffeurNumber == null || ChauffeurNumber == undefined) {
                ChauffeurNumber = 0;
            }
            var ChauffeurName = $("#ChauffeurName").val();
            if (ChauffeurName == null || ChauffeurName == undefined) {
                ChauffeurName = 0;
            }
            var str = 'ChauffeurNumber=' + ChauffeurNumber + "&ChauffeurName=" + ChauffeurName;
            var oldStr = tabChauffeur.getPageCondition(tabChauffeur.getCurPage());
            if (oldStr.indexOf(str) > -1) {
                layer.confirm("是否要导出当前的数据？", {
                    icon: 3,
                    btn: ['确定', '取消']
                }, function (layerIndex) {
                    layer.close(layerIndex);
                    window.open("ExportToExcelChauffeur?" + str);
                })
            }
            else {
                layer.msg("预览是否是需要导出", { icon: 0, title: '提示' });
            }
        });
        //打印
        $("#Print").click(function () {
            var ChauffeurNumber = $("#ChauffeurNumber").val();
            if (ChauffeurNumber == null || ChauffeurNumber == undefined) {
                ChauffeurNumber = 0;
            }
            var ChauffeurName = $("#ChauffeurName").val();
            if (ChauffeurName == null || ChauffeurName == undefined) {
                ChauffeurName = 0;
            }
            window.open("PrintAchievementChauffeur?ChauffeurNumber=" + ChauffeurNumber + "&ChauffeurName=" + ChauffeurName);
        })
    </script>
</body>
</html>
